package com.easoft.code.pos;

import com.easoft.code.pos.data.pojos.PosUsuario;
import com.easoft.code.pos.ui.FormPrincipal;
import java.awt.EventQueue;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * Hello world!
 *
 */
public class App {

    public static JFrame mainForm;
    public static PosUsuario currentUser;
    public static Integer caja = 1;

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        int[] i = new int[10];

        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FormPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                EventQueue.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            //UIManager.setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel");
                            UIManager.setLookAndFeel("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel");
                        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
                            e.printStackTrace(System.err);
                        }
                    }
                });
                FormPrincipal formPrincipal = new FormPrincipal();

                formPrincipal.setExtendedState(formPrincipal.getExtendedState() | JFrame.MAXIMIZED_BOTH);
                formPrincipal.setVisible(
                        true);

                formPrincipal.setIconImage(
                        new ImageIcon(FormPrincipal.class
                                .getResource("easoftpos.png")).getImage());
                mainForm = formPrincipal;
            }
        });

    }
}
